function TrManager() {

	this.grid = null;
	this.filterManager = null;
	this.transactions = new Array();
	this.dataAdapter = null;

	this.init = function(book) {
		console.log('trManager.init');
		var self = this;
		this.grid = new TransactionsGrid('#transactionsGrid');
		this.dataAdapter = new $.jqx.dataAdapter(new TrSource(), {
			loadComplete: function() {
				console.log('data loaded');
				self.transactions = self.dataAdapter.loadedData.items;
				self.grid.render(self.transactions);
			}
		});
		this.grid.init(this.dataAdapter);

		this.filterManager = new TrFilterManager(function() { self.reload(); },
			'#transactionsFilter',
			'#trFilterApplyImmidiately',
			'#trFilterApplyButton',
			'#trFilterIncomesCheckBox',
			'#trFilterOutcomesCheckBox',
			'#trFilterTransfersCheckBox',
			'#trFilterApprovedOnly',
			'#trFilterDateFrom',
			'#trFilterDateTo',
			'#trFilterSrcAccount',
			'#trFilterDstAccount',
			'#trFilterAccountsSwapBtn',
			'#trFilterAccountsAddBtn',
			'#trFilterAccounts',
			'#trFilterCategory',
			'#trFilterCategoryTree',
			'#trFilterCategories',
			'#trFilterTags');
		this.filterManager.init(book);
	};

	this.reload = function() {
		this.grid.update(this.dataAdapter);
	}
};